rm(list = ls())

library(tidyverse)

res_main <- readRDS('data/fig5.rds')

pd <- position_dodge(.3)

p1 <- ggplot(res_main, aes(x = issue, y = estimate, col = foreigner_share, fill = foreigner_share)) + 
    geom_errorbar(aes(ymin = conf.low, ymax = conf.high), width = 0, linewidth = .2, position = pd) + 
    geom_errorbar(aes(ymin = conf.low90, ymax = conf.high90), width = 0, linewidth = 0.6, position = pd) + 
    geom_point(shape = 21, fill = 'white', position = pd) + 
    theme_minimal() + 
    facet_grid(~ outcome_type) + 
    geom_hline(yintercept = 0, linetype = 'dotdash') + 
    labs(x = '',
         y = 'Effect estimate (s.d.)',
         col = '') + 
    coord_flip() +
    theme(legend.position = 'bottom') +
    scale_color_grey()

p1 

